import csv

# 写入 csv
with open('student.csv', 'a+', encoding='utf-8') as file:
    writer = csv.writer(file)
    # 一次写一行
    # writer.writerow(['张三', 23, 85])
    # 一次写入多行
    ls = [['张三', 23, 92], ['李四', 22, 85], ['王五', 23, 89]]
    writer.writerows(ls)
# csv 读取
with open('student.csv', 'r', encoding='utf-8', newline='\n') as file:
    reader = csv.reader(file)
    for row in reader:
        print(row)
